﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using SQDebugging;
using UnrarService;

namespace WPFServiceTest
{
    /// <summary>
    /// Ist nur zum Testen der Serviceklassen da, da sich der Service nicht debuggen lässt.
    /// </summary>
    public partial class MainWindow : Window
    {
        #region Member
        private string _filePath;
        private List<string> _password = new List<string>();
        private DirectoryWatcher _dirWatcher;
        #endregion

        public MainWindow()
        {
            InitializeComponent();

            //Aktuellen Applicationname festlegen
            SQDebugging.Eventlogging.MyAppName = "UnrarService";

            _filePath = @"C:\Temp";
            _password.Add("serienjunkies.org");
            _password.Add("serienjunkies.dl.am");
            _dirWatcher = new DirectoryWatcher(_filePath, _password);
            _dirWatcher.StartWatcher(_filePath);

        }

        private void uxEntpacken_Click(object sender, RoutedEventArgs e)
        {

            Entpacker entpacker = new Entpacker(_filePath);
            entpacker.Password = _password;
            entpacker.Entpacken(uxPfad.Text);

        }

        private void uxUmbenennen_Click(object sender, RoutedEventArgs e)
        {
            System.IO.Path.ChangeExtension(uxPfad.Text, "Blubb");
        }

    }
}
